javascript:
(function(){
  if (document.getElementById('app10979261223_iframe_canvas')) {
    if (confirm('You need to break out the mw-frame first.\nPress OK to do it now.')) {
      window.location.href = document.getElementById('app10979261223_iframe_canvas').src;
      return;
    }
  } else if (document.getElementsByClassName('canvas_iframe_util')[0]) {
    if (confirm('You need to break out the mw-frame first.\nPress OK to do it now.')) {
      window.location.href = document.getElementsByClassName('canvas_iframe_util')[0].src;
      return;
    }
  } else {
    document.body.parentNode.style.overflowY = "scroll";
    document.body.style.overflowX = "auto";
    document.body.style.overflowY = "auto";
    try {
      if (typeof FB != 'undefined') {
        FB.CanvasClient.stopTimerToSizeToContent;
        window.clearInterval(FB.CanvasClient._timer);
        FB.CanvasClient._timer = -1;
      }
		document.getElementById('mw_zbar').parentNode.removeChild(document.getElementById('mw_zbar'));
    }
    catch(fberr) {}
  }

var content = document.getElementById('inner_page'),version='TopMafia v1.08',spock_div=document.getElementById('spockdiv'),mafias,results,result,level,type,fights,heists,jobs;
if (!spock_div) {
	spock_div=document.createElement("div");
	spock_div.id = 'spockdiv';
	spock_div.innerHTML='<div>You are using '+version+' - <a href="http://www.spockholm.com/mafia/bookmarklets.php" target="_top">Spockholm Mafia Tools</a></div>';
	content.insertBefore(spock_div,content.firstChild);
}

mafias = document.evaluate('count(//div[@style="float: left; width: 720px; border-top: 1px solid rgb(51, 51, 51);"])', document, null, XPathResult.ANY_TYPE, null );
if (mafias.numberValue == 0) {
	mafias = document.evaluate('count(//div[@style="float: left; width: 720px; border-top: 1px solid #333333;"])', document, null, XPathResult.ANY_TYPE, null ); 
	results = document.evaluate('//div[@style="float: left; width: 720px; border-top: 1px solid #333333;"]', document, null, 7, null );
}
else {
	results = document.evaluate('//div[@style="float: left; width: 720px; border-top: 1px solid rgb(51, 51, 51);"]', document, null, 7, null);
}
 for (i=0;i<mafias.numberValue;i++) {
  result = results.snapshotItem(i);
  level=/Level (\d+)/.exec(result.childNodes[3].lastChild.data);
  type=result.childNodes[5].lastChild.data;
  fights=result.childNodes[7].lastChild.data;
  heists=result.childNodes[9].lastChild.data;
  jobs=result.childNodes[11].lastChild.data;
  eval(level[1],type,fights,heists,jobs);
}

function eval(l,t,f,h,j){
	if (t == 'Fearless') {
		var w ='Wheelman ';
		if ((l >= 1) && (l <= 18)) { result.childNodes[3].lastChild.data = w+'1%'; }
		if ((l >= 19) && (l <= 28)) { result.childNodes[3].lastChild.data = w+'2%'; }
		if ((l >= 29) && (l <= 38)) { result.childNodes[3].lastChild.data = w+'3%'; }
		if ((l >= 39) && (l <= 48)) { result.childNodes[3].lastChild.data = w+'4%'; }
		if ((l >= 49) && (l <= 58)) { result.childNodes[3].lastChild.data = w+'5%'; }
		if ((l >= 59) && (l <= 78)) { result.childNodes[3].lastChild.data = w+'6%'; }
		if ((l >= 79) && (l <= 98)) { result.childNodes[3].lastChild.data = w+'7%'; }
		if ((l >= 99) && (l <= 148)) { result.childNodes[3].lastChild.data = w+'8%'; }
		if ((l >= 149) && (l <= 198)) { result.childNodes[3].lastChild.data = w+'9%'; }
		if (l >= 199) {
			result.childNodes[3].lastChild.data = w+'10%';
			result.childNodes[3].style.backgroundColor="#006600";
		}
	}
	if (t == 'Maniac') {
		var b ='Button Man ';
		if ((l >= 1) && (l <= 18)) { result.childNodes[3].lastChild.data = b+'+1 Attack'; }
		if ((l >= 19) && (l <= 28)) { result.childNodes[3].lastChild.data = b+'+2 Attack'; }
		if ((l >= 29) && (l <= 38)) { result.childNodes[3].lastChild.data = b+'+3 Attack'; }
		if ((l >= 39) && (l <= 48)) { result.childNodes[3].lastChild.data = b+'+4 Attack'; }
		if ((l >= 49) && (l <= 58)) { result.childNodes[3].lastChild.data = b+'+5 Attack'; }
		if ((l >= 59) && (l <= 78)) { result.childNodes[3].lastChild.data = b+'+6 Attack'; }
		if ((l >= 79) && (l <= 98)) { result.childNodes[3].lastChild.data = b+'+7 Attack'; }
		if ((l >= 99) && (l <= 148)) { result.childNodes[3].lastChild.data = b+'+8 Attack'; }
		if ((l >= 149) && (l <= 198)) { result.childNodes[3].lastChild.data = b+'+9 Attack'; }
		if ((l >= 199) && (l <= 298)) { result.childNodes[3].lastChild.data = b+'+10 Attack'; }
		if (l >= 299) {
			result.childNodes[3].lastChild.data = b+'+11 Attack'; 
			result.childNodes[3].style.backgroundColor="#006600";
		}
	}
	if (t == 'Mogul') {
		var ba ='Bagman ';
		if ((l >= 1) && (l <= 18)) { result.childNodes[3].lastChild.data = ba+'5%'; }
		if ((l >= 19) && (l <= 28)) { result.childNodes[3].lastChild.data = ba+'6%'; }
		if ((l >= 29) && (l <= 38)) { result.childNodes[3].lastChild.data = ba+'7%'; }
		if ((l >= 39) && (l <= 48)) { result.childNodes[3].lastChild.data = ba+'8%'; }
		if ((l >= 49) && (l <= 58)) { result.childNodes[3].lastChild.data = ba+'9%'; }
		if ((l >= 59) && (l <= 78)) { result.childNodes[3].lastChild.data = ba+'10%'; }
		if ((l >= 79) && (l <= 98)) { result.childNodes[3].lastChild.data = ba+'11%'; }
		if ((l >= 99) && (l <= 148)) { result.childNodes[3].lastChild.data = ba+'12%'; }
		if ((l >= 149) && (l <= 198)) { result.childNodes[3].lastChild.data = ba+'13%'; }
		if ((l >= 199) && (l <= 298)) { result.childNodes[3].lastChild.data = ba+'14%'; }
		if (l >= 299) {
			result.childNodes[3].lastChild.data = ba+'15%'; 
			result.childNodes[3].style.backgroundColor="#006600";
		}
	}
	var m = 'Mastermind ';
	if ((j >= 1) && (j <= 18)) { result.childNodes[11].lastChild.data = m+'1%'; }
	if ((j >= 19) && (j <= 98)) { result.childNodes[11].lastChild.data = m+'2%'; }	
	if ((j >= 99) && (j <= 498)) { result.childNodes[11].lastChild.data = m+'3%'; }
	if ((j >= 499) && (j <= 998)) { result.childNodes[11].lastChild.data = m+'4%'; }	
	if ((j >= 999) && (j <= 2998)) { result.childNodes[11].lastChild.data = m+'5%'; }
	if ((j >= 2999) && (j <= 4998)) { result.childNodes[11].lastChild.data = m+'6%'; }	
	if ((j >= 4999) && (j <= 6998)) { result.childNodes[11].lastChild.data = m+'7%'; }
	if ((j >= 6999) && (j <= 9998)) { result.childNodes[11].lastChild.data = m+'8%'; }	
	if ((j >= 9999) && (j <= 12998)) { result.childNodes[11].lastChild.data = m+'9%'; }
	if (j >= 12999) {
		result.childNodes[11].lastChild.data = m+'10%';
		result.childNodes[11].style.backgroundColor="#006600";
	}

	var bo = 'Bodyguard ';	
	if ((f >= 1) && (f <= 18)) { result.childNodes[7].lastChild.data = bo+'+1 Defense'; }
	if ((f >= 19) && (f <= 98)) { result.childNodes[7].lastChild.data = bo+'+2 Defense'; }	
	if ((f >= 99) && (f <= 498)) { result.childNodes[7].lastChild.data = bo+'+3 Defense'; }
	if ((f >= 499) && (f <= 998)) { result.childNodes[7].lastChild.data = bo+'+4 Defense'; }	
	if ((f >= 999) && (f <= 3998)) { result.childNodes[7].lastChild.data = bo+'+5 Defense'; }
	if ((f >= 3999) && (f <= 6998)) { result.childNodes[7].lastChild.data = bo+'+6 Defense'; }	
	if ((f >= 6999) && (f <= 9998)) { result.childNodes[7].lastChild.data = bo+'+7 Defense'; }
	if ((f >= 9999) && (f <= 19998)) { result.childNodes[7].lastChild.data = bo+'+8 Defense'; }	
	if ((f >= 19999) && (f <= 39998)) { result.childNodes[7].lastChild.data = bo+'+9 Defense'; }
	if ((f >= 39999) && (f <= 49998)) { result.childNodes[7].lastChild.data = bo+'+10 Defense'; }	
	if (f >= 49999) {
		result.childNodes[7].lastChild.data = bo+'+11 Defense';
		result.childNodes[7].style.backgroundColor="#006600";
	}
	
	var s = 'Safecracker ';
	if ((h >= 1) && (h <= 18)) { result.childNodes[9].lastChild.data = s+'5%'; }
	if ((h >= 19) && (h <= 98)) { result.childNodes[9].lastChild.data = s+'6%'; }	
	if ((h >= 99) && (h <= 498)) { result.childNodes[9].lastChild.data = s+'7%'; }
	if ((h >= 499) && (h <= 998)) { result.childNodes[9].lastChild.data = s+'8%'; }	
	if ((h >= 999) && (h <= 3998)) { result.childNodes[9].lastChild.data = s+'9%'; }
	if ((h >= 3999) && (h <= 6998)) { result.childNodes[9].lastChild.data = s+'10%'; }	
	if ((h >= 6999) && (h <= 9998)) { result.childNodes[9].lastChild.data = s+'11%'; }
	if ((h >= 9999) && (h <= 19998)) { result.childNodes[9].lastChild.data = s+'12%'; }	
	if ((h >= 19999) && (h <= 39998)) { result.childNodes[9].lastChild.data = s+'13%'; }
	if ((h >= 39999) && (h <= 49998)) { result.childNodes[9].lastChild.data = s+'14%'; }	
	if (h >= 49999) {
		result.childNodes[9].lastChild.data = s+'15%';
		result.childNodes[9].style.backgroundColor="#006600";	
	}

	return;
}
})()